<template>
  <view class="page-rma-list">
    <view class="rma-wrap" v-if="items.length">
      <view class="rma-item" @click="proxy.$util.navigateTo('/pages/account/rmas/info/index', { id: item.id })" v-for="(item, index) in items" :key="index">
        <view class="content">
          <view class="title">{{ $t('account.rmas.form.text_type') }}：{{ item.type_format }}</view>
          <view class="product">{{ $t('common.text_product') }}：{{ item.product_name }}</view>
          <view class="bottom">
            <view class="status">{{ $t('common.text_status') }}：{{ item.status_format }}</view>
            <view class="date_added">{{ item.created_at }}</view>
          </view>
        </view>
      </view>
    </view>

    <no-item v-if="items && !items.length"></no-item>
  </view>
</template>

<script setup>
// import {ref,reactive} from "vue"
const { proxy } = getCurrentInstance()

const items = ref([])

onLoad(e => {
  loadData()
})

const loadData = () => {
  proxy.$http.get('rmas').then(res => {
    items.value = res.data
  })
}
</script>

<style lang="scss" scoped>
@import './index.scss';
</style>
